package com.lzh.persevere.controller;

import com.lzh.persevere.common.R;
import com.lzh.persevere.common.ResultUtil;
import com.lzh.persevere.model.qo.PageModelQO;
import com.lzh.persevere.model.ro.photoWall.AddPhotoWallRO;
import com.lzh.persevere.service.PhotoWallService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.Map;

/**
 * 照片墙controller
 *
 * @author luzhiheng
 * @since 2025-08-09
 */
@Api(tags = "照片墙")
@RestController
@RequestMapping("/photoWall")
public class PhotoWallController {

    @Resource
    private PhotoWallService photoWallService;

    @ApiOperation(value = "分页查询")
    @PostMapping("/findPhotoWallPageList")
    public R<Map<String, Object>> findPhotoWallPageList(@Valid @RequestBody PageModelQO qo) {
        return ResultUtil.success(photoWallService.findPhotoWallPageList(qo));
    }

    @ApiOperation(value = "批量添加照片")
    @PostMapping("/addPhotoWallBatch")
    public R<Boolean> addPhotoWallBatch(@Valid @RequestBody AddPhotoWallRO ro) {
        return ResultUtil.success(photoWallService.addPhotoWallBatch(ro));
    }
}
